package co.fitstart.admin.dao;

import com.demo2do.core.persistence.annotation.Dynamic;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import co.fitstart.entity.user.UserMonthCount;

/**
 * 
 * @author LZJ
 *
 */
@Dynamic("hibernate")
public interface UserMonthCountDao {
    
	 /**
     * 
     * @param thisMonth
     * @param studentId
     * @return
     */
    @Query("FROM UserMonthCount WHERE expireTimes > 0 AND everyMonth = :thisMonth AND studentId = :studnetId")
    public UserMonthCount getExpireTimes(@Variable("thisMonth") String thisMonth,@Variable("studnetId") Long studentId);
    
    /**
     * 
     * @param thisMonth
     * @param studentId
     * @return
     */
    @Query("FROM UserMonthCount WHERE everyMonth = :thisMonth AND studentId = :studnetId")
    public UserMonthCount loadAllTimes(@Variable("thisMonth") String thisMonth,@Variable("studnetId") Long studentId);
}
